<?php

namespace app\console\validate;

use think\Validate;

class SupplierValidate extends Validate
{
    protected $rule = [
        'name|名字'         => 'require',
        'province|省'       => 'require',
        'city|市'           => 'require',
        'address|详细地址'   => 'require',
        'linkman|联系人'     => 'require',
        'phone|电话号码'     => 'require|number',
        'wechat|微信号'      => 'require',
        'page|页码'          => 'require|number',
        'perPage|每页数量'   => 'require|number',
        'search_start_time|查询开始区间'   => 'date',
        'search_end_time|查询结束区间'     => 'date',
    ];

    protected $scene = [
        'create' => ['name', 'province', 'city', 'address', 'linkman', 'phone', 'wechat'] ,
        'getPage'    => ['page', 'perPage', 'search_start_time', 'search_end_time'] ,
        'getAll'    => ['search_start_time', 'search_end_time'] ,
    ];

}